package org.urey.web.service;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.urey.dao.entity.Test;
import org.urey.dao.service.TestService;
import org.urey.web.entity.TestTest;

public class Service implements InitializingBean {

	@Autowired
	private TestService testService;

	@Override
	public void afterPropertiesSet() throws Exception {
		// testService.test(TestTest.class);
	}

	public Long save(String name) {
		TestTest t = testService.save(TestTest.class, name);
		return t.getId();
	}

	public String get(String id) {
		Test t = testService.get(Long.parseLong(id));
		return t.getName();
	}

}
